<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Introduction_to_Algorithms: IntrodunctionToAlgorithm::GraphAlgorithm Namespace Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Introduction_to_Algorithms
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="namespaces.html"><span>Namespace&#160;List</span></a></li>
      <li><a href="namespacemembers.html"><span>Namespace&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('namespace_introdunction_to_algorithm_1_1_graph_algorithm.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">IntrodunctionToAlgorithm::GraphAlgorithm Namespace Reference</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_a_d_j_list_graph.html">ADJListGraph</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">ADJListGraph：图的邻接表表示，算法导论22章22.1节  <a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_a_d_j_list_graph.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_edge.html">Edge</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Edge：图的边，算法导论22章22.1节  <a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_edge.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html">MatrixGraph</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">MatrixGraph：图的矩阵表示，算法导论22章22.1节  <a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_matrix_graph.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html">Vertex</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vertex：图的顶点，算法导论22章22.1节  <a href="struct_introdunction_to_algorithm_1_1_graph_algorithm_1_1_vertex.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a156de3aaf516156695e591dd7a696e13"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a156de3aaf516156695e591dd7a696e13"><td class="memTemplItemLeft" align="right" valign="top">T&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespace_introdunction_to_algorithm_1_1_graph_algorithm.html#a156de3aaf516156695e591dd7a696e13">unlimit</a> ()</td></tr>
<tr class="memdesc:a156de3aaf516156695e591dd7a696e13"><td class="mdescLeft">&#160;</td><td class="mdescRight">unlimit：返回正无穷的函数  <a href="#a156de3aaf516156695e591dd7a696e13">More...</a><br /></td></tr>
<tr class="separator:a156de3aaf516156695e591dd7a696e13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a23d91f2128b4201b0b6452d57fdffd18"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a23d91f2128b4201b0b6452d57fdffd18"><td class="memTemplItemLeft" align="right" valign="top">bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespace_introdunction_to_algorithm_1_1_graph_algorithm.html#a23d91f2128b4201b0b6452d57fdffd18">is_unlimit</a> (T t)</td></tr>
<tr class="memdesc:a23d91f2128b4201b0b6452d57fdffd18"><td class="mdescLeft">&#160;</td><td class="mdescRight">is_unlimit：判断是否正无穷  <a href="#a23d91f2128b4201b0b6452d57fdffd18">More...</a><br /></td></tr>
<tr class="separator:a23d91f2128b4201b0b6452d57fdffd18"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a23d91f2128b4201b0b6452d57fdffd18"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool IntrodunctionToAlgorithm::GraphAlgorithm::is_unlimit </td>
          <td>(</td>
          <td class="paramtype">T&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>is_unlimit：判断是否正无穷 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>待判断的数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>: 如果该数是正无穷大，则返回<code>true</code>，否则返回<code>false</code></dd></dl>
<p>将本函数判断一个数是否正无穷；若是则返回true;若不是则返回false</p>
<p>这里将大于等于<code>std::numeric_limits&lt;T&gt;::max()/3</code>的数判断结果为正无穷 &gt;因为考虑到正无穷减去一个数必须保证结果也是正无穷 </p>

<p>Definition at line <a class="el" href="algorithms_8h_source.html#l00101">101</a> of file <a class="el" href="algorithms_8h_source.html">algorithms.h</a>.</p>

</div>
</div>
<a class="anchor" id="a156de3aaf516156695e591dd7a696e13"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T IntrodunctionToAlgorithm::GraphAlgorithm::unlimit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>unlimit：返回正无穷的函数 </p>
<dl class="section return"><dt>Returns</dt><dd>: 正无穷大的数</dd></dl>
<p>将本函数的返回值定义为正无穷。在算法导论图算法中，经常用到正无穷。通常对正无穷的操作是:</p>
<ul>
<li>将边的权重或者节点的<code>key</code>设为正无穷</li>
<li>对正无穷加、减一个有限的数，结果还是正无穷</li>
</ul>
<p>这里将<code>std::numeric_limits&lt;T&gt;::max()/2</code>设为正无穷，考虑到正无穷加上一个较大的数必须保证不能溢出 </p>

<p>Definition at line <a class="el" href="algorithms_8h_source.html#l00086">86</a> of file <a class="el" href="algorithms_8h_source.html">algorithms.h</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_introdunction_to_algorithm.html">IntrodunctionToAlgorithm</a></li><li class="navelem"><a class="el" href="namespace_introdunction_to_algorithm_1_1_graph_algorithm.html">GraphAlgorithm</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
